package com.fansaikj.erp.domain;

/*
 * Copyright © 2020-2035 erupt.xyz All rights reserved.
 * Author: YuePeng (erupts@126.com)
 */

import javax.persistence.*;

import com.fansaikj.erp.domain.comtactCompany.CustomerCompany;
import lombok.Data;
import lombok.EqualsAndHashCode;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.jpa.model.BaseModel;

import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Erupt(name = "初始数据")
@Table(name = "erp_initial_data")
@Entity
@Data
public class InitialData extends BaseModel {

    @EruptField(
            views = @View(
                    title = "主键ID", show = false
            ),
            edit = @Edit(
                    title = "主键ID",
                    type = EditType.INPUT, show = false, notNull = true,
                    inputType = @InputType
            )
    )
    private Long id;

    @ManyToOne
    @EruptField(
            views = @View(
                    title = "结算单位",
                    column = "name"
            ),
            edit = @Edit(
                    title = "结算单位",
                    type = EditType.REFERENCE_TABLE, search = @Search, notNull = true,
                    referenceTableType = @ReferenceTableType(id = "id", label = "name")
            )
    )
    private SettlementCompany settlementCompany;

    @ManyToOne
    @EruptField(
            views = @View(
                    title = "往来单位",
                    column = "name"
            ),
            edit = @Edit(
                    title = "往来单位",
                    type = EditType.REFERENCE_TABLE, search = @Search, notNull = true,
                    referenceTableType = @ReferenceTableType(id = "id", label = "name")
            )
    )
    private CustomerCompany contactCompany;

    @EruptField(
            views = @View(
                    title = "期初金额"
            ),
            edit = @Edit(
                    title = "期初金额",
                    type = EditType.INPUT,
                    inputType = @InputType
            )
    )
    private String openingBalance;

    @EruptField(
            views = @View(
                    title = "核销金额"
            ),
            edit = @Edit(
                    title = "核销金额",
                    type = EditType.INPUT,
                    inputType = @InputType
            )
    )
    private String writeOffBalance;

    @EruptField(
            views = @View(
                    title = "期初发票"
            ),
            edit = @Edit(
                    title = "期初发票",
                    type = EditType.INPUT,
                    inputType = @InputType
            )
    )
    private String openingInvoice;

    @EruptField(
            views = @View(
                    title = "核销发票"
            ),
            edit = @Edit(
                    title = "核销发票",
                    type = EditType.INPUT,
                    inputType = @InputType
            )
    )
    private String writeOffInvoice;

    @EruptField(
            views = @View(
                    title = "创建人", show = false
            ),
            edit = @Edit(
                    title = "创建人",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String createBy;

    @EruptField(
            views = @View(
                    title = "创建时间", show = false
            ),
            edit = @Edit(
                    title = "创建时间",
                    type = EditType.DATE, show = false,
                    dateType = @DateType
            )
    )
    private Date createTime;

    @EruptField(
            views = @View(
                    title = "修改人", show = false
            ),
            edit = @Edit(
                    title = "修改人",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String updateBy;

    @EruptField(
            views = @View(
                    title = "修改时间", show = false
            ),
            edit = @Edit(
                    title = "修改时间",
                    type = EditType.DATE, show = false,
                    dateType = @DateType
            )
    )
    private Date updateTime;

    @EruptField(
            views = @View(
                    title = "备注"
            ),
            edit = @Edit(
                    title = "备注",
                    type = EditType.TEXTAREA
            )
    )
    private String remark;

    @EruptField(
            views = @View(
                    title = "删除状态(0-正常,1-已删除)", show = false
            ),
            edit = @Edit(
                    title = "删除状态(0-正常,1-已删除)",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String delFlag;

}
